<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>用户推广文章管理</title>
    <?php require 'templates/common/head.html'; ?>
    <style type="text/css">
        .divleft{width: 30%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2% }
        .divleft2{width: 15%; float: left; text-align:left; border-right: solid 1px #d5d5d5; margin-right: 2% }
        .divright{ width: 15%; float:right; text-align: right;}

    </style>
</head>
<body>


<div class="container-fluid">
    <?php require 'templates/common/nav.html'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center"><h3 class="panel-title">用户推广文章管理</h3></div>
        <div class="panel-body">
            <?=@$分享内容->data['分享介绍']?>
            <div style="width:110px; height:10px;">
                <a href="index.php?m=promotion_articles&a=promotion_text" type="button" class="btn btn-success">设置推广文字</a>
            </div>
        </div>
        <div class="panel-body">
            <div class="panel-heading text-right">
                <a href="index.php?m=promotion_articles&a=update" type="button" class="btn btn-primary">添加推广文章</a>
            </div>
            <div class="panel-group"   id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default" >
                    <div class="panel-heading" style="background-color:#d5d5d5" >
                        <div class="row">
                            <div class="col-xs-4 text-justify" style="width:100%;">
                                <div class="divleft"><b  >标题</b></div>
                                <div class="divleft"><b  >备注</b></div>
                                <div class="divleft2" > <b >是否显示</b></div>
                                <div class="divright" > <b >操作</b></div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <?php foreach($promotionArticles as $key => $value):?>
                        <div class="panel-heading"  style=" <?php if($key%2==0){echo "background-color:#DFF0D8;";}else{ echo "border-top: solid 2px #ffffff;";}?>">
                            <div class="row">
                                <div class="col-xs-4 text-justify" style="width:100%;">
                                    <div class="divleft"><span><?= $value['标题'] ?></span></div>
                                    <div class="divleft"><span><?= $value['备注'] ?></span></div>
                                    <div class="divleft2">
                                        <span >
                                            <?php if($value['是否显示']=="是"):?>
                                                <span>已显示</span>
                                                <a href="index.php?m=promotion_articles&a=update&id=<?=$value['id'];?>&show=否"><input type="button" value="隐藏文章"></a>
                                            <?php else: ?>
                                                <span>未显示</span>
                                                <a href="index.php?m=promotion_articles&a=update&id=<?=$value['id'];?>&show=是"><input type="button"  value="显示文章"></a>
                                            <?php endif;?>
                                        </span>
                                    </div>
                                    <div class="divright">
                                        <span >&nbsp;<a href="index.php?m=promotion_articles&a=update&id=<?= $value['id'] ?>">编辑</a> </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php endforeach; ?>

                </div>
            </div>
        </div>

    <div><?= $page->showpage();?></div>
    </div>

</div>
<?php require 'templates/common/foot.html'; ?>
</body>
</html>